package org.consistenthash;

import java.util.TreeMap;

public class Tree_Map_Demo {

//    public static void main(String[] args) {
//
//        // Creating an empty TreeMap
//        TreeMap<Integer, String> tree_map = new TreeMap<Integer, String>();
//
//        // Mapping string values to int keys
//        tree_map.put(10, "Geeks");
//        tree_map.put(15, "4");
//        tree_map.put(20, "Geeks");
//        tree_map.put(25, "Welcomes");
//        tree_map.put(30, "You");
//
//        // Displaying the TreeMap
//        System.out.println("The original map is:"
//                + tree_map);
//
//        // Displaying the submap
//        System.out.println("The tailMap is " + tree_map.tailMap(21));
//    }
//
//





        public static void main(String[] args)
        {

            // Creating an empty TreeMap
            TreeMap<String, Integer> tree_map = new TreeMap<String, Integer>();

            // Mapping int values to string keys
            tree_map.put("Geeks", 10);
            tree_map.put("4", 15);
            tree_map.put("Geeks", 20);
            tree_map.put("Welcomes", 25);
            tree_map.put("You", 30);

            // Displaying the TreeMap
            System.out.println("The original map is:"
                    + tree_map);

            // Displaying the tailMap
            System.out.println("The tailMap is " + tree_map.tailMap("Geeks", false));
        }

}
